<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<<script type="text/javascript">
<!--
function setAction(action) {
	var frm = document.productTypeMaintenanceForm;
	frm.handlerMethod.value = action;
}
//-->
</script>
<c:set var="contextPath" value="${pageContext.request.contextPath}"/>

<h2 align="center">Product Type Maintenance</h2>
<table border="0" cellpadding="0" cellspacing="0" width="676">
    <tr>
        <td align="right"><b class="required">* Required fields</b></td>
    </tr>
</table>
<html:form action="/productTypeMaintenance.do">
<div id="errorMess">
<html:errors/>
</div>
<html:hidden property="handlerMethod" value="add" />
<input type="hidden" name="sec" value="maint" />
<table class="tblBg" width="685" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<th colspan="3">Edit Product Type:</th>
	</tr>
	<tr>
		<td class="text" width="186"><span id ="productTypeId_field">Product Type:<b class="required">*</b></span></td>
		<td width="154">
			<html:select property="productTypeId">
				<html:option value="-1">Select Product Type</html:option>
				<html:optionsCollection  name="productTypes"  label="productTypeName" value="productTypeId"/>
			</html:select>
		</td>
		<td width="341"><input type="submit" name="edit" value="Edit" onClick="setAction('edit');" style="width:50px;" class="button" onmouseover="this.className='buttonOn';" onmouseout="this.className='button';"/></td>
	</tr>
	<tr class="controlRow">
		<td class="text" width="186"><img src="${contextPath}/images/Spc.gif" width="165" height="1"/></td>
		<td width="154"><img src="${contextPath}/images/Spc.gif" width="145" height="1"/></td>
		<td width="341"><img src="${contextPath}/images/Spc.gif" width="345" height="1"/></td>
	</tr>
</table><br/>
<table class="tblBg" width="685" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<th colspan="2">${param.handlerMethod == 'edit' ? 'Edit Existing' : 'Create New'}&nbsp;Product Type:</th>
	</tr>
	<tr>
		<td class="text" width="191"><span id="mediaDocType_field">Product Type Name:<b class="required">*</b></span></td>
		<td width="494"><html:text property="productTypeName" maxlength="12" /></td>
	</tr>
	<tr>
		<td class="text" width="191"><span id="mediaDocName_field">Product Type Description:<b class="required">*</b></span></td>
		<td width="494"><html:text property="productTypeDescription" maxlength="50" /></td>
	</tr>
	<tr>
		<td class="text" width="191">&nbsp;</td>
		<td id="btnTD" width="494">
			<c:if test="${empty param.handlerMethod}">
			<input type="submit" name="SubmitButton" value="Create" onClick="setAction('add')"  class="button" onmouseover="this.className='buttonOn';" onmouseout="this.className='button';"/>
			</c:if>
			
			<c:if test="${param.handlerMethod == 'edit' || param.handlerMethod == 'update'}">
			<input type="submit"  name="SubmitButton" value="Update" onClick="setAction('update')"  class="button" onmouseover="this.className='buttonOn';" onmouseout="this.className='button';"/>
				&nbsp;&nbsp;<input id="delete" type="submit" value="Delete" onclick="setAction('delete')" class="button" onmouseover="this.className='buttonOn';" onmouseout="this.className='button';"/>
			</c:if>
			&nbsp;&nbsp;<button id="cancel" onclick="window.location.href=unescape(window.location.pathname);" class="button" onmouseover="this.className='buttonOn';return false;" onmouseout="this.className='button';">Cancel</button>
			
		</td>
	</tr>
	<tr class="controlRow">
		<td class="text" width="191"><img src="${contextPath}/images/Spc.gif" width="165" height="1"/></td>
		<td width="494"><img src="/images/Spc.gif" width="500" height="1"/></td>
	</tr>
</table>

</html:form>

